package com.souku.finance.application.utils;

import android.app.Activity;
import android.content.Intent;

import com.souku.finance.application.ui.login.LoginActivity;
import com.souku.finance.application.ui.invite.PayActivity;

/**
 * Created by Android on 2017/1/13.
 */

public class PayUtil {

    public static void check(Activity context, String id, boolean isNewHandDeail) {
        if (ShareUtil.getInstance().getBoolean(Constant.IsLogin)) {
//            if (isNewHandDeail && !ShareUtil.getInstance().getBoolean(Constant.IsNewHand)) {
//                ToastUtil.show("仅新手可投");
//                return;
//            }
            Intent intent = new Intent(context, PayActivity.class);
            intent.putExtra(Constant.Default, id);
            context.startActivity(intent);
        } else {
            Intent intent = new Intent(context, LoginActivity.class);
            context.startActivity(intent);
        }
    }

    public static int getEoIntMoney(String money){
        return (int) (Double.parseDouble(money) * 100);
    }

    public static String getMemo(String type) {
        int tp = Integer.parseInt(type);
        if (tp == 1) return "充值";
        else if (tp == 2) return "投标成功";
        else if (tp == 3) return "招标成功";
        else if (tp == 4) return "偿还本息";
        else if (tp == 5) return "回收本息";
        else if (tp == 6) return "提前还款";
        else if (tp == 7) return "提前回收";
        else if (tp == 8) return "申请提现";
        else if (tp == 9) return "提现手续费";
        else if (tp == 10) return "借款管理费";
        else if (tp == 11) return "逾期罚息";
        else if (tp == 12) return "逾期管理费";
        else if (tp == 13) return "人工充值";
        else if (tp == 14) return "借款服务费";
        else if (tp == 15) return "出售债权";
        else if (tp == 16) return "购买债权";
        else if (tp == 17) return "债权转让管理费";
        else if (tp == 18) return "开户奖励";
        else if (tp == 19) return "流标还返";
        else if (tp == 20) return "投标管理费";
        else if (tp == 21) return "投标逾期收入";
        else if (tp == 22) return "兑换";
        else if (tp == 23) return "邀请返利";
        else if (tp == 24) return "投标返利";
        else if (tp == 25) return "签到成功";
        else if (tp == 26) return "逾期罚金（垫付后）";
        else if (tp == 27) return "其他费用";
        return "";
    }
}
